// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Util
{
    using WixToolset.Data;
    using WixToolset.Util.Symbols;

    public static partial class UtilSymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition PerfmonManifest = new IntermediateSymbolDefinition(
            UtilSymbolDefinitionType.PerfmonManifest.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(PerfmonManifestSymbolFields.ComponentRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(PerfmonManifestSymbolFields.File), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(PerfmonManifestSymbolFields.ResourceFileDirectory), IntermediateFieldType.String),
            },
            typeof(PerfmonManifestSymbol));
    }
}

namespace WixToolset.Util.Symbols
{
    using WixToolset.Data;

    public enum PerfmonManifestSymbolFields
    {
        ComponentRef,
        File,
        ResourceFileDirectory,
    }

    public class PerfmonManifestSymbol : IntermediateSymbol
    {
        public PerfmonManifestSymbol() : base(UtilSymbolDefinitions.PerfmonManifest, null, null)
        {
        }

        public PerfmonManifestSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.PerfmonManifest, sourceLineNumber, id)
        {
        }

        public IntermediateField this[PerfmonManifestSymbolFields index] => this.Fields[(int)index];

        public string ComponentRef
        {
            get => this.Fields[(int)PerfmonManifestSymbolFields.ComponentRef].AsString();
            set => this.Set((int)PerfmonManifestSymbolFields.ComponentRef, value);
        }

        public string File
        {
            get => this.Fields[(int)PerfmonManifestSymbolFields.File].AsString();
            set => this.Set((int)PerfmonManifestSymbolFields.File, value);
        }

        public string ResourceFileDirectory
        {
            get => this.Fields[(int)PerfmonManifestSymbolFields.ResourceFileDirectory].AsString();
            set => this.Set((int)PerfmonManifestSymbolFields.ResourceFileDirectory, value);
        }
    }
}